<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div id="app"></div>

  <script src="../react/react.development.js"></script>
  <script src="../react/react-dom.development.js"></script>
  <script src="../react/babel.min.js"></script>

  <script type="text/babel">
    class App extends React.Component {
      constructor(props) {
        super(props)
        this.state = {
          names: ['abc', 'cba', 'nba', 'mba', 'dna'],
          numbers: [110, 112, 119, 114, 120]
        }
      }
      render() {
        return (
          <div>
            <h2>名字列表</h2>
            <ul>
              {
                this.state.names.map((item) => {
                  return <li key={item}>{item}</li>
                })
              }
            </ul>
            <h2>数组列表</h2>
            <ul>
              {
                this.state.numbers.map(item => {
                  return <li key={item}>{item}</li>
                })
              }
            </ul>
          </div>
        )
      }
    }
    ReactDOM.render(<App />, document.getElementById('app'))
  </script>
</body>

</html>